package cloud.shyidong.system.request;

import cloud.shyidong.core.request.SimpleInsertRequest;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * <p>
 * 用户表添加请求
 * </p>
 *
 * @author syd
 * @since 2023-05-31 13:14:46
 */
@Data
public class SystemUserInsertRequest extends SimpleInsertRequest {
    
    /**
     * 登录名称
     */
    @NotBlank(message = "缺少登录名称")
    @Size(min = 8, max = 16, message = "登录名称的长度为{min}到{max}位")
    private String username;
    
    /**
     * 登录密码
     */
    @NotBlank(message = "缺少登录密码")
    @Size(min = 8, max = 16, message = "登录密码的长度为{min}到{max}位")
    private String password;
    
    /**
     *
     */
    @NotBlank(message = "缺少确认密码")
    @Size(min = 8, max = 16, message = "确认密码的长度为{min}到{max}位")
    private String confirmPassword;
    
    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    @Size(min = 2, max = 16, message = "姓名的长度为{min}到{max}位")
    private String name;
    
    /**
     * 电话号码
     */
    @NotBlank(message = "电话号码不能为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "电话号码格式有误")
    @Size(min = 7, max = 12, message = "电话号码的长度为{min}到{max}位")
    private String phone;
    
    /**
     * 邮箱
     */
    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = "^([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+\\.[a-zA-Z]{2,3}$", message = "邮箱格式有误")
    @Size(min = 8, max = 32, message = "邮箱的长度为{min}到{max}位")
    private String email;
    
    /**
     *
     */
    @NotNull(message = "状态必须选择")
    private Integer status;
    
    /**
     *
     */
    @NotNull(message = "排序不能为空")
    private Integer sortIndex;
    
    /**
     *
     */
    private String remark;
    
    /**
     * 角色编号
     */
    private List<Long> roleIds;
    
}
